package com.aizhixin.test.question.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.aizhixin.test.question.dto.answerRecordDTO;
import com.aizhixin.test.question.dto.bestKonlege;
import com.aizhixin.test.question.service.anserRecordService;
import com.aizhixin.test.question.vo.MostKonwledgeVO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;

@RestController
@RequestMapping(value="/v1/open/anserRecord")
@Api(tags="答题记录API")
@Slf4j
public class anserRecordCotroller {
	@Autowired
	private anserRecordService anserRecordService;
	 
	@GetMapping(value="/{userId}",produces=MediaType.APPLICATION_JSON_VALUE)
	@ApiOperation(httpMethod="GET",value="输入用户Id,然后显示这个用户正确率最高的三个领域",
	notes="输入用户Id,然后显示这个用户正确率最高的三个领域<br><br><b>@author xixi</b>")
	public List<bestKonlege> getKonledgeMax(
			@ApiParam(value="用户ID",required=true)
			@PathVariable Long userId){
		return anserRecordService.getMaxKonledgeByUserId(userId);
	}
	@GetMapping(value="/question/{userid}",produces=MediaType.APPLICATION_JSON_VALUE)
	@ApiOperation(httpMethod="GET",value="输入用户id后返回这个用户，返回这个用户前五个领域以及正确，错误"
	,notes="输入用户id后返回这个用户，返回这个用户前五个领域以及正确，错误<br><br><b>@author xixi</b>")
	public  List<MostKonwledgeVO> getkonledgeFive(
			@ApiParam(value="用户Id",required=true)
			@PathVariable Long userid){
		return anserRecordService.getfiveKonwledge(userid);
	}
	
}
